package client.entidades;

import comum.IMsgSource;
import java.util.Observable;

/**
 *
 * @author Anderson
 */
public class User implements IMsgSource {

    private String nickname;
    private String userName;
    private String ip;

    public User() {
    }

    public User(String nick) {
        this.nickname = nick;
    }

    public User(String nick, String userName) {
        this.nickname = nick;
        this.userName = userName;
    }

    public User(String nick, String userName, String ip) {
        this.nickname = nick;
        this.userName = userName;
        this.ip = ip;
    }

    public String getUser() {
        return this.userName + "@" + this.ip;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getNick() {
        return nickname;
    }

    public void setNick(String nick) {
        this.nickname = nick;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final User other = (User) obj;
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        return hash;
    }

    @Override
    public String toString() {
        return nickname;
    }

    public String getStringName() {
        return this.nickname;
    }

    public boolean isChannel() {
        return true;
    }

    public boolean isUser() {
        return false;
    }
}
